using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Linq;
  
public partial class Admin : BaseMasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ReBindBreadCrumbs();

            if (!Request.IsAuthenticated)
            {
                /*btnLogout.Visible = false;
                btnDetails.Visible = false;*/
            }
        }
    }

    protected void btnLogout_Click(object sender, EventArgs e)
    {
        FormsAuthentication.SignOut();
        Response.Redirect("~");
    }


    public override void ReBindBreadCrumbs()
    {
        BaseMasterPage.BreadCrumbCollection tmpBreadcrumbs = new BaseMasterPage.BreadCrumbCollection();
        tmpBreadcrumbs.Add("Home", "~");
        Page.GetBreadCrumbs(tmpBreadcrumbs);
        breadcrumbs.DataSource = tmpBreadcrumbs.Select((item, index) => new { Name = item.Name, Url = (item.Url ?? "~/NoPage.aspx"), IsLast = index == tmpBreadcrumbs.Count - 1 });
        breadcrumbs.DataBind();
    }
}
